package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerBroadcastMessageInfo implements IQLResponse
{
    /// <summary>
    /// 唯一Id
    /// </summary>
    public long Id;

    /// <summary>
    /// 播报内容
    /// </summary>
    public String Content;

    /// <summary>
    /// 时间间隔，单位秒
    /// </summary>
    public long Interval;

    /// <summary>
    /// 持续时间，单位秒
    /// </summary>
    public long Duration;

    /// <summary>
    /// 创建时间
    /// </summary>
    public String CreateTime;

    /// <summary>
    /// 创建操作人
    /// </summary>
    public String CreateOperater;

    /// <summary>
    /// 状态 0生效中 1已移除 2已过期
    /// </summary>
    public long State;

    /// <summary>
    /// 移除时间
    /// </summary>
    public String RemoveTime;

    /// <summary>
    /// 移除人
    /// </summary>
    public String RemoveOperater;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("id"))
            Id = t.getLong("id");
        if (t.has("content"))
            Content = t.getString("content");
        if (t.has("interval"))
            Interval = t.getLong("interval");
        if (t.has("duration"))
            Duration = t.getLong("duration");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
        if (t.has("create_operater"))
            CreateOperater = t.getString("create_operater");
        if (t.has("state"))
            State = t.getLong("state");
        if (t.has("remove_time"))
            RemoveTime = t.getString("remove_time");
        if (t.has("remove_operater"))
            RemoveOperater = t.getString("remove_operater");
    }
}
